<?php

###############################
# CONEXION A LA BASE DE DATOS #                 
###############################

if ($_SERVER['HTTP_HOST']=='localhost')  // AMBIENTE LOCAL
{ 
    define('DB_HOST', 'localhost');
	define('DB_USER', 'root');
	define('DB_PASSWORD', '');
	define('DB_DATABASE', 'db_shopping_manager');
}
else // AMBIENTE DEV
{ 
    define('DB_HOST', 'mysql14.000webhost.com');
	define('DB_USER', 'a8621830_smroot');
	define('DB_PASSWORD', 'sm1234');
	define('DB_DATABASE', 'a8621830_smdev');   
}

$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if (!$link) die('No se pudo conectar a la base de datos: '.mysql_error());
mysql_select_db(DB_DATABASE, $link) or die('No se pudo abrir base de datos: '.mysql_error());

?>